package models;
 
import java.util.*;
import javax.persistence.*;
 
import play.db.jpa.*;
 
@Entity
public class Reservation extends Model {
 
    public Date createdOn;
	public Date confirmedOn;
	public Date cancledOn;
    public Date latestArrival;
    public Date arrivedOn;
    public String comment;
	public Double price;
    public Date deletedOn;

    @ManyToOne
    public User reservedBy;

    @ManyToOne
    public User reservedTo;

    @ManyToOne
    public User confirmedBy;

    @ManyToOne
    public User canceledBy;

    @ManyToOne
    public User deletedBy;

    @ManyToOne
    public ObjectLevelItem item;

    @ManyToOne
    public Event event;
    
    
    public Reservation(ObjectLevelItem objectLevelItem, User reservedBy, User reservedTo, String comment, Date createdOn, Date confirmedOn,Date cancledOn,double price) {
        this.reservedBy = reservedBy;
        this.reservedTo = reservedTo;
        this.comment = comment;
        this.createdOn = createdOn;
		this.confirmedOn = confirmedOn;
		this.cancledOn = cancledOn;
		this.price = price;
        this.item = objectLevelItem;
    }

    @Override
    public String toString() {
        return "rezervacija na ime "+this.reservedTo.profile.toString()+" itema "+item.toString();    //To change body of overridden methods use File | Settings | File Templates.
    }
}